package adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

import com.bigchun.seeland.R;

import java.util.List;

import bean.ShaixuanBean;


public class ImageAdapter extends BaseAdapter {


    private int checkitem = -1;
    private String type;
    private Context context;
    private LayoutInflater mInflater;
    List<ShaixuanBean> mData;
    public ImageAdapter(Context context){
        this.mInflater = LayoutInflater.from(context);
    }

    public ImageAdapter(Context context, List<ShaixuanBean> mData){
        this.context=context;
        this.mInflater = LayoutInflater.from(context);
        this.mData=mData;


    }
    public void setData(List<ShaixuanBean> mData,int checkitem,String type){
        this.mData=mData;
        this.checkitem=checkitem;
        this.type=type;
        notifyDataSetChanged();
    }

    @Override
    public int getCount() {
        return mData.size();
    }

    @Override
    public Object getItem(int arg0) {
        return null;
    }

    @Override
    public long getItemId(int arg0) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder = null;
        if (convertView == null) {

            holder=new ViewHolder();

            convertView = mInflater.inflate(R.layout.item_img, null);

            holder.img = (ImageView) convertView.findViewById(R.id.img);
            convertView.setTag(holder);

        }else {
            holder = (ViewHolder)convertView.getTag();
        }



        return convertView;
    }

    public static class ViewHolder{

        ImageView img ;



    }


}